﻿// EXP0510.cpp : 我们之前实现的统计元音字母的程序存在一个问题：如果元音字母以大写形式出现，不会被统计在内。编写一段程序，既统计元音字母的小写形式，也统计元音字母的大写形式，也就是说，新程序遇到'a'和'A'都应该递增 aCnt 的值，以此类推。
//

#include <iostream>
#include <vector>
using namespace std;

int main()
{
	cout << "输入一段字符串" << endl;
	vector<char> vowels = { 'a','e','i','o','u' };
	vector<int> vowelNum(5, 0);
	char ch;
	while (cin >> ch)
	{
		for (int i = 0; i < 5; ++i)
		{
			if (tolower(ch) == vowels[i]) ++vowelNum[i];
		}

	}
	copy(vowels.begin(), vowels.end(), ostream_iterator<char>(cout, " "));
	cout << endl;
	copy(vowelNum.begin(), vowelNum.end(), ostream_iterator<int>(cout, " "));
	cout << endl;


	/*unsigned aCnt = 0, eCnt = 0, iCnt = 0, oCnt = 0, uCnt = 0;
	char ch;
	while (cin >> ch)
		switch (ch)
		{
		case 'a':
		case 'A':
			++aCnt;
			break;
		case 'e':
		case 'E':
			++eCnt;
			break;
		case 'i':
		case 'I':
			++iCnt;
			break;
		case 'o':
		case 'O':
			++oCnt;
			break;
		case 'u':
		case 'U':
			++uCnt;
			break;
		}

	cout << "Number of vowel a(A): \t" << aCnt << '\n'
		<< "Number of vowel e(E): \t" << eCnt << '\n'
		<< "Number of vowel i(I): \t" << iCnt << '\n'
		<< "Number of vowel o(O): \t" << oCnt << '\n'
		<< "Number of vowel u(U): \t" << uCnt << endl;*/

	return 0;
}


